# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DFAReporting.V4.Model.BillingRate do
  @moduledoc """


  ## Attributes

  *   `currencyCode` (*type:* `String.t`, *default:* `nil`) - Billing currency code in ISO 4217 format.
  *   `endDate` (*type:* `String.t`, *default:* `nil`) - End date of this billing rate.
  *   `id` (*type:* `String.t`, *default:* `nil`) - ID of this billing rate.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Name of this billing rate. This must be less than 256 characters long.
  *   `rateInMicros` (*type:* `String.t`, *default:* `nil`) - Flat rate in micros of this billing rate. This cannot co-exist with tiered rate.
  *   `startDate` (*type:* `String.t`, *default:* `nil`) - Start date of this billing rate.
  *   `tieredRates` (*type:* `list(GoogleApi.DFAReporting.V4.Model.BillingRateTieredRate.t)`, *default:* `nil`) - Tiered rate of this billing rate. This cannot co-exist with flat rate.
  *   `type` (*type:* `String.t`, *default:* `nil`) - Type of this billing rate.
  *   `unitOfMeasure` (*type:* `String.t`, *default:* `nil`) - Unit of measure for this billing rate.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :currencyCode => String.t() | nil,
          :endDate => String.t() | nil,
          :id => String.t() | nil,
          :name => String.t() | nil,
          :rateInMicros => String.t() | nil,
          :startDate => String.t() | nil,
          :tieredRates => list(GoogleApi.DFAReporting.V4.Model.BillingRateTieredRate.t()) | nil,
          :type => String.t() | nil,
          :unitOfMeasure => String.t() | nil
        }

  field(:currencyCode)
  field(:endDate)
  field(:id)
  field(:name)
  field(:rateInMicros)
  field(:startDate)
  field(:tieredRates, as: GoogleApi.DFAReporting.V4.Model.BillingRateTieredRate, type: :list)
  field(:type)
  field(:unitOfMeasure)
end

defimpl Poison.Decoder, for: GoogleApi.DFAReporting.V4.Model.BillingRate do
  def decode(value, options) do
    GoogleApi.DFAReporting.V4.Model.BillingRate.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.DFAReporting.V4.Model.BillingRate do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
